<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fnx" uri="http://java.sun.com/jsp/jstl/functionsx"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="f" uri="http://www.sctv.com/tags/form"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/views/head.jsp"/>
    <script type="text/javascript">
      $(function() {
        $("#validForm").validate();
        $("input[name='name']").focus();
      });
      function confirmDelete() {
        return confirm("<s:message code='confirmDelete'/>");
      }
    </script>
</head>
<body class="skin-blue content-body">
<jsp:include page="/WEB-INF/views/commons/show_message.jsp"/>
<div class="content-header">
    <h1>回看节目单 - <s:message code="${oprt=='edit' ? 'edit' : 'create'}"/></h1>
</div>

<div class="content">
    <div class="box box-primary">
        <form class="form-horizontal" id="validForm" action="${oprt=='edit' ? 'update' : 'save'}.do" method="post">
            <tags:search_params/>
            <f:hidden name="oid" value="${bean.id}"/>
            <f:hidden name="position" value="${position}"/>
            <input type="hidden" name="programbackId" value="${programbackId}" />
            <input type="hidden" id="redirect" name="redirect" value="edit"/>
            <div class="box-header with-border">
                <div class="btn-toolbar">
                    <div class="btn-group">
                        <shiro:hasPermission name="core:sensitive_word:create">
                            <button class="btn btn-default" type="button" onclick="location.href='create.do?${searchstring}';"<c:if test="${oprt=='create'}"> disabled="disabled"</c:if>><s:message code="create"/></button>
                        </shiro:hasPermission>
                    </div>
                    <div class="btn-group">
                        <shiro:hasPermission name="core:sensitive_word:delete">
                            <button class="btn btn-default" type="button" onclick="if(confirmDelete()){location.href='delete.do?ids=${bean.id}&${searchstring}';}"<c:if test="${oprt=='create'}"> disabled="disabled"</c:if>><s:message code="delete"/></button>
                        </shiro:hasPermission>
                    </div>
                    <div class="btn-group">
                        <button class="btn btn-default" type="button" onclick="location.href='edit.do?id=${side.prev.id}&position=${position-1}&${searchstring}';"<c:if test="${empty side.prev}"> disabled="disabled"</c:if>><s:message code="prev"/></button>
                        <button class="btn btn-default" type="button" onclick="location.href='edit.do?id=${side.next.id}&position=${position+1}&${searchstring}';"<c:if test="${empty side.next}"> disabled="disabled"</c:if>><s:message code="next"/></button>
                    </div>
                    <div class="btn-group">
                        <button class="btn btn-default" type="button" onclick="location.href='list.do?programbackId=${programbackId}&${searchstring}';"><s:message code="return"/></button>
                    </div>
                </div>
            </div>
            <div class="box-body">
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-4 control-label"><em class="required">*</em>节目名称</label>
                            <div class="col-sm-8">
                                <f:text class="form-control required" name="name" value="${oprt=='edit' ? (bean.name) : ''}" maxlength="100"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">视频来源</label>
                            <div class="col-sm-8">
                               <select name="vidioresuoce">
                                   <f:option value="视频库" selected="${bean.vidioresuoce}" default="0">视频库</f:option>
                                   <f:option value="上传视频" selected="${bean.vidioresuoce}" default="0">上传视频</f:option>
                               </select>
                            </div>
                        </div>
                    </div>
                    <%--<div class="col-sm-6">--%>
                        <%--<div class="form-group">--%>
                            <%--<label class="col-sm-4 control-label">节目关键词</label>--%>
                            <%--<div class="col-sm-8">--%>
                                <%--<select name="mainword">--%>
                                    <%--<c:forEach var="program" items="${programList}">--%>
                                        <%--<option value="${program.name}">${program.name}</option>--%>
                                    <%--</c:forEach>--%>
                                <%--</select>--%>
                            <%--</div>--%>
                        <%--</div>--%>
                    <%--</div>--%>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">发布时间</label>
                            <div class="col-sm-8">
                                <input type="text" name="time" value="<fmt:formatDate value="${bean.time}" pattern="yyyy-MM-dd'T'HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-ddTHH:mm:ss'});" class="form-control" style="padding-left:3px;padding-right:3px;"/>
                            </div>
                        </div>
                    </div>
                </div>

                <%--<div class="row">--%>
                    <%--<div class="col-sm-8">--%>
                            <%--视频图片：<tags:image_upload name="smallImage" value="${bean.smallImage}" width="${field.customs['imageWidth']}" height="${field.customs['imageHeight']}" watermark="${field.customs['imageWatermark']}" scale="${field.customs['imageScale']}" exact="${field.customs['imageExact']}"/>--%>
                   <%--</div>--%>
                <%--</div>--%>

                <div class="row">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">频道封面</label>
                            <div class="col-sm-10">
                                <script>
                                  function fn_smallImage(src) {
                                    Cms.scaleImg("img_smallImage", 200, 100, src);
                                  };
                                </script>
                                <div style="display:table;width:100%;">
                                    <div style="display:table-cell;vertical-align:middle;">
                                        <div class="input-group">
                                            <span class="input-group-addon">地址</span>
                                            <input type="text" id="smallImage" name="smallImage" value="${bean.smallImage}"
                                                   onchange="fn_smallImage(this.value);" class="form-control ">
                                        </div>
                                        <div class="form-inline" style="margin-top:3px;">
                                            <f:text class="form-control" value="请上传16:9的图片"/>
                                            <%--<div class="input-group">--%>
                                                <%--<span class="input-group-addon">宽</span>--%>
                                                <%--<input type="text" id="w_smallImage" value="180" style="width:70px;"--%>
                                                       <%--class="form-control">--%>
                                            <%--</div>--%>
                                            <%--<div class="input-group">--%>
                                                <%--<span class="input-group-addon">高</span>--%>
                                                <%--<input type="text" id="h_smallImage" value="120" style="width:70px;"--%>
                                                       <%--class="form-control">--%>
                                            <%--</div>--%>
                                            <button class="btn btn-default" type="button" id="smallImageButton">选择
                                            </button>
                                            <%--<button class="btn btn-default" type="button"--%>
                                                    <%--onclick="imgCrop('smallImage');">裁剪--%>
                                            <%--</button>--%>
                                            <object id="SWFUpload_0" type="application/x-shockwave-flash"
                                                    data="/static/vendor/swfupload/swfupload.swf?preventswfcaching=1502702265304"
                                                    width="54" height="34" class="swfupload">
                                                <param name="wmode" value="transparent">
                                                <param name="movie"
                                                       value="/static/vendor/swfupload/swfupload.swf?preventswfcaching=1502702265304">
                                                <param name="quality" value="high">
                                                <param name="allowScriptAccess" value="always">
                                                <param name="flashvars"
                                                       value="movieName=SWFUpload_0&amp;uploadURL=%2Fcmscp%2Fcore%2Fupload_image.do%3Bjsessionid%3DB7EED2164EABD024D9BFE3361803971D%3F_site%3D&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=0&amp;params=&amp;filePostName=file&amp;fileTypes=*.*&amp;fileTypesDescription=Images&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=0&amp;debugEnabled=false&amp;buttonImageURL=&amp;buttonWidth=54&amp;buttonHeight=34&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-100&amp;buttonDisabled=false&amp;buttonCursor=-2">
                                            </object>
                                            <button class="btn btn-default" type="button">上传</button>
                                            <button class="btn btn-default" type="button" id="smallImageSwfCancel"
                                                    onclick="smallImageSwfUpload.cancelQueue();" disabled="">取消
                                            </button>
                                        </div>
                                        <div>
                                            <%--<label class="checkbox-inline"><input type="checkbox" id="s_smallImage"--%>
                                                                                  <%--checked="checked">压缩</label>--%>
                                            <%--<label class="checkbox-inline"><input type="checkbox" id="e_smallImage">不按原图比例</label>--%>
                                            <%--<label class="checkbox-inline"><input type="checkbox"--%>
                                                                                  <%--id="wm_smallImage">水印</label>--%>
                                        </div>
                                        <input type="hidden" id="t_smallImage" value="false">
                                        <input type="hidden" id="tw_smallImage" value="116">
                                        <input type="hidden" id="th_smallImage" value="77">
                                    </div>
                                    <div style="width:200px;display:table-cell;vertical-align:middle;text-align:center;">
                                        <img id="img_smallImage" style="display:none;">
                                    </div>
                                </div>
                                <div id="smallImageSwfProgress"></div>
                                <script>
                                  var smallImageSwfUpload = Cms.swfUploadImage("smallImage", {
                                    jsessionid: "B7EED2164EABD024D9BFE3361803971D",
                                    file_size_limit: "0",
                                    file_types: "*.*"
                                  });
                                  $(function () {
                                    Cms.f7.uploads("smallImage", "smallImage", {
                                      settings: {"title": "选择附件"},
                                      callbacks: {
                                        "ok": function (src) {
                                          fn_smallImage(src);
                                        }
                                      }
                                    });
                                  });
                                  fn_smallImage("");
                                </script>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="row">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">上传视频</label>
                            <div class="col-sm-10">
                                <div class="input-group">
                                    <span class="input-group-addon"><em class="required">*</em><s:message code="fileName"/></span>
                                    <f:text class="form-control required" id="videoName" name="videoName" value="${bean.videoName}"
                                            maxlength="255"/>
                                </div>
                                <div class="input-group">
                                    <span class="input-group-addon"><em class="required">*</em><s:message code="fileUrl"/></span>
                                    <f:text class="form-control required" id="video" name="video" value="${bean.video}"
                                            maxlength="255"/>
                                </div>
                                <div class="input-group">
                                    <span class="input-group-addon"><s:message code="fileLength"/></span>
                                    <f:text id="videoLength" name="videoLength" value="${bean.videoLength}"
                                            class="form-control {digits:true,max:2147483647}" maxlength="10"/>
                                    <span class="input-group-addon"><s:message code="videoTime"/></span>
                                    <f:text class="form-control" id="videoTime" name="videoTime" value="${bean.videoTime}"
                                            maxlength="100"/>
                                    <span class="input-group-btn">
                                <button class="btn btn-default" id="videoButton" type="button"><s:message
                                        code='choose'/></button>
                                  <span id="videoSwfButton"></span>
                                  <button type="button" class="btn btn-default"><s:message code="upload"/></button>
                                  <button class="btn btn-default" id="videoSwfCancel" type="button"
                                          onclick="videoSwfUpload.cancelQueue();" disabled><s:message
                                          code="cancel"/></button>
                              </span>
                                </div>
                                <div id="videoSwfProgress"></div>
                                <script type="text/javascript">
                                  $(function () {
                                    Cms.f7.videolib("video", "videoName", {
                                      settings: {"title": "<s:message code="webFile.chooseUploads"/>"}
                                    });
                                  });
                                </script>
                                <script type="text/javascript">
                                  var videoSwfUpload = Cms.swfUploadVideo("video", {
                                    jsessionid: "<%=request.getSession().getId()%>",
                                    file_size_limit: "${GLOBAL.upload.videoLimit}",
                                    file_types: "${GLOBAL.upload.videoTypes}"
                                  });
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
                <%--<div class="row">--%>
                    <%--&lt;%&ndash;<c:when test="${field.name eq 'video'}">&ndash;%&gt;--%>
                        <%--视频上传地址：<div class="input-group">--%>
                            <%--<span class="input-group-addon"><s:message code="fileName"/></span>--%>
                            <%--<f:text class="form-control" id="videoName" name="videoname" value="${bean.videoname}" maxlength="255"/>--%>
                        <%--</div>--%>
                        <%--<div class="input-group">--%>
                            <%--<span class="input-group-addon"><s:message code="fileUrl"/></span>--%>
                            <%--<f:text class="form-control" id="video" name="video" value="${bean.video}" maxlength="255"/>--%>
                        <%--</div>--%>
                        <%--<div class="input-group">--%>
                            <%--<span class="input-group-addon"><s:message code="fileLength"/></span>--%>
                            <%--<f:text id="videoLength" name="videolength" value="${bean.videolength}" class="form-control {digits:true,max:2147483647}" maxlength="10"/>--%>
                            <%--<span class="input-group-addon"><s:message code="videoTime"/></span>--%>
                            <%--<f:text class="form-control" id="videoTime" name="vadiotime" value="${bean.vadiotime}" maxlength="100"/>--%>
                            <%--<span class="input-group-btn">--%>
						      	<%--<button class="btn btn-default" id="videoButton" type="button"><s:message code='choose'/></button>--%>
							      <%--<span id="videoSwfButton"></span>--%>
							      <%--<button type="button" class="btn btn-default"><s:message code="upload"/></button>--%>
							      <%--<button class="btn btn-default" id="videoSwfCancel" type="button" onclick="videoSwfUpload.cancelQueue();" disabled><s:message code="cancel"/></button>--%>
						      <%--</span>--%>
                        <%--</div>--%>
                        <%--<div id="videoSwfProgress"></div>--%>
                        <%--<script type="text/javascript">--%>
                          <%--$(function() {--%>
                            <%--Cms.f7.videolib("video","videoName",{--%>
                              <%--settings: {"title": "<s:message code="webFile.chooseUploads"/>"}--%>
                            <%--});--%>
                          <%--});--%>
                        <%--</script>--%>
                        <%--<script type="text/javascript">--%>
                          <%--var videoSwfUpload = Cms.swfUploadVideo("video",{--%>
                            <%--jsessionid: "<%=request.getSession().getId()%>",--%>
                            <%--file_size_limit: "${GLOBAL.upload.videoLimit}",--%>
                            <%--file_types: "${GLOBAL.upload.videoTypes}"--%>
                          <%--});--%>
                        <%--</script>--%>
                    <%--&lt;%&ndash;</c:when>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<c:when test="${field.name eq 'doc'}">&ndash;%&gt;--%>
                <%--</div>--%>
            <div class="box-footer">
                <%--<button class="btn btn-primary" type="submit"><s:message code="save"/></button>--%>
                <button class="btn btn-default" type="submit" onclick="$('#redirect').val('list');">确认</button>
                <button class="btn btn-default" type="button" onclick="javascript :history.back(-1);">取消</button>

            </div>
        </form>
    </div>
</div>
</body>
</html>